package ${package.Controller};

<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>
import com.skyworth.${package.ModuleName}api.pojo.dto.${entity?lower_case}.req.*;
import com.skyworth.${package.ModuleName}api.pojo.dto.${entity?lower_case}.res.*;
import com.skyworth.${package.ModuleName}api.api.${entity}Api;
import ${package.Service}.${table.serviceName};
import com.skyworth.core.pojo.dto.PageResDTO;
import com.skyworth.core.pojo.dto.ResDTO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>

/**
 * <p>
 * ${table.comment!} 模块接口
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} implements ${entity}Api {
<#else>
public class ${table.controllerName} implements ${entity}Api {
</#if>

    @Resource
    private ${table.serviceName} ${(table.serviceName)?uncap_first};

    /**
    * 查询分页数据
    */
    @Override
    public ResDTO<PageResDTO<${entity}ListResDTO>> list(@RequestBody @Valid ${entity}ListReqDTO ${entity?uncap_first}ListReqDTO){
      return null;
    }

    /**
    * 根据id查询
    */
    @Override
    public ResDTO<${entity}GetResDTO> get(@PathVariable("id") Long id){
      return null;
    }

    /**
    * 新增
    */
    @Override
    public ResDTO<Void> add(@RequestBody @Valid ${entity}AddReqDTO ${entity?uncap_first}AddReqDTO){
      return null;
    }

    /**
    * 删除
    */
    @Override
    public ResDTO<Void> delete(@PathVariable("ids") List<Long> ids){
      return null;
    }

    /**
    * 修改
    */
    @Override
    public ResDTO<Void> update(@RequestBody @Valid ${entity}UpdateReqDTO ${entity?uncap_first}UpdateReqDTO){
      return null;
    }
}
</#if>
